/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('rtc-white-board', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateAppRequest {
  appName?: string(name='AppName'),
}

model CreateAppResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    appID?: string(name='AppID'),
  }(name='Result'),
}

model CreateAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAppResponseBody(name='body'),
}

async function createAppWithOptions(request: CreateAppRequest, runtime: Util.RuntimeOptions): CreateAppResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateApp',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApp(request: CreateAppRequest): CreateAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppWithOptions(request, runtime);
}

model CreateWhiteBoardRequest {
  appID?: string(name='AppID'),
  userId?: string(name='UserId'),
}

model CreateWhiteBoardResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    docKey?: string(name='DocKey'),
  }(name='Result'),
}

model CreateWhiteBoardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateWhiteBoardResponseBody(name='body'),
}

async function createWhiteBoardWithOptions(request: CreateWhiteBoardRequest, runtime: Util.RuntimeOptions): CreateWhiteBoardResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateWhiteBoard',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createWhiteBoard(request: CreateWhiteBoardRequest): CreateWhiteBoardResponse {
  var runtime = new Util.RuntimeOptions{};
  return createWhiteBoardWithOptions(request, runtime);
}

model DescribeAppsRequest {
  appID?: string(name='AppID'),
  appStatus?: long(name='AppStatus'),
  pageNum?: long(name='PageNum'),
  pageSize?: long(name='PageSize'),
}

model DescribeAppsResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    appList?: [ 
      {
        appID?: string(name='AppID'),
        appName?: string(name='AppName'),
        callbackType?: string(name='CallbackType'),
        callbackUrl?: string(name='CallbackUrl'),
        createTime?: string(name='CreateTime'),
        domainNames?: string(name='DomainNames'),
        status?: long(name='Status'),
      }
    ](name='AppList'),
    totalNum?: long(name='TotalNum'),
    totalPage?: long(name='TotalPage'),
  }(name='Result'),
}

model DescribeAppsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeAppsResponseBody(name='body'),
}

async function describeAppsWithOptions(request: DescribeAppsRequest, runtime: Util.RuntimeOptions): DescribeAppsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.appStatus)) {
    body['AppStatus'] = request.appStatus;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApps',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApps(request: DescribeAppsRequest): DescribeAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsWithOptions(request, runtime);
}

model DescribeWhiteBoardRecordingsRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  pageNum?: long(name='PageNum'),
  pageSize?: long(name='PageSize'),
}

model DescribeWhiteBoardRecordingsResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    recordingList?: [ 
      {
        appID?: string(name='AppID'),
        docKey?: string(name='DocKey'),
        operateList?: [ string ](name='OperateList'),
        recordId?: string(name='RecordId'),
        userId?: string(name='UserId'),
      }
    ](name='RecordingList'),
    totalNum?: long(name='TotalNum'),
    totalPage?: long(name='TotalPage'),
  }(name='Result'),
}

model DescribeWhiteBoardRecordingsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeWhiteBoardRecordingsResponseBody(name='body'),
}

async function describeWhiteBoardRecordingsWithOptions(request: DescribeWhiteBoardRecordingsRequest, runtime: Util.RuntimeOptions): DescribeWhiteBoardRecordingsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWhiteBoardRecordings',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWhiteBoardRecordings(request: DescribeWhiteBoardRecordingsRequest): DescribeWhiteBoardRecordingsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWhiteBoardRecordingsWithOptions(request, runtime);
}

model DescribeWhiteBoardsRequest {
  appID?: string(name='AppID'),
  docStatus?: long(name='DocStatus'),
  pageNum?: long(name='PageNum'),
  pageSize?: long(name='PageSize'),
}

model DescribeWhiteBoardsResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    docList?: [ 
      {
        appID?: string(name='AppID'),
        createTime?: string(name='CreateTime'),
        createUserId?: string(name='CreateUserId'),
        docKey?: string(name='DocKey'),
        status?: long(name='Status'),
      }
    ](name='DocList'),
    totalNum?: long(name='TotalNum'),
    totalPage?: long(name='TotalPage'),
  }(name='Result'),
}

model DescribeWhiteBoardsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeWhiteBoardsResponseBody(name='body'),
}

async function describeWhiteBoardsWithOptions(request: DescribeWhiteBoardsRequest, runtime: Util.RuntimeOptions): DescribeWhiteBoardsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docStatus)) {
    body['DocStatus'] = request.docStatus;
  }
  if (!Util.isUnset(request.pageNum)) {
    body['PageNum'] = request.pageNum;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DescribeWhiteBoards',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeWhiteBoards(request: DescribeWhiteBoardsRequest): DescribeWhiteBoardsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeWhiteBoardsWithOptions(request, runtime);
}

model OpenWhiteBoardRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  userId?: string(name='UserId'),
}

model OpenWhiteBoardResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    documentAccessInfo?: {
      accessToken?: string(name='AccessToken'),
      collabHost?: string(name='CollabHost'),
      permission?: long(name='Permission'),
      userInfo?: {
        avatarUrl?: string(name='AvatarUrl'),
        nick?: string(name='Nick'),
        nickPinyin?: string(name='NickPinyin'),
        userId?: string(name='UserId'),
      }(name='UserInfo'),
    }(name='DocumentAccessInfo'),
  }(name='Result'),
}

model OpenWhiteBoardResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OpenWhiteBoardResponseBody(name='body'),
}

async function openWhiteBoardWithOptions(request: OpenWhiteBoardRequest, runtime: Util.RuntimeOptions): OpenWhiteBoardResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'OpenWhiteBoard',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function openWhiteBoard(request: OpenWhiteBoardRequest): OpenWhiteBoardResponse {
  var runtime = new Util.RuntimeOptions{};
  return openWhiteBoardWithOptions(request, runtime);
}

model PauseWhiteBoardRecordingRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  recordId?: string(name='RecordId'),
  userId?: string(name='UserId'),
}

model PauseWhiteBoardRecordingResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    pauseTime?: long(name='PauseTime'),
  }(name='Result'),
}

model PauseWhiteBoardRecordingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: PauseWhiteBoardRecordingResponseBody(name='body'),
}

async function pauseWhiteBoardRecordingWithOptions(request: PauseWhiteBoardRecordingRequest, runtime: Util.RuntimeOptions): PauseWhiteBoardRecordingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.recordId)) {
    body['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'PauseWhiteBoardRecording',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function pauseWhiteBoardRecording(request: PauseWhiteBoardRecordingRequest): PauseWhiteBoardRecordingResponse {
  var runtime = new Util.RuntimeOptions{};
  return pauseWhiteBoardRecordingWithOptions(request, runtime);
}

model RefreshUsersPermissionsRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  userIds?: string(name='UserIds'),
}

model RefreshUsersPermissionsResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model RefreshUsersPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RefreshUsersPermissionsResponseBody(name='body'),
}

async function refreshUsersPermissionsWithOptions(request: RefreshUsersPermissionsRequest, runtime: Util.RuntimeOptions): RefreshUsersPermissionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.userIds)) {
    body['UserIds'] = request.userIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RefreshUsersPermissions',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function refreshUsersPermissions(request: RefreshUsersPermissionsRequest): RefreshUsersPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return refreshUsersPermissionsWithOptions(request, runtime);
}

model ResumeWhiteBoardRecordingRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  recordId?: string(name='RecordId'),
  userId?: string(name='UserId'),
}

model ResumeWhiteBoardRecordingResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    resumeTime?: long(name='ResumeTime'),
  }(name='Result'),
}

model ResumeWhiteBoardRecordingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResumeWhiteBoardRecordingResponseBody(name='body'),
}

async function resumeWhiteBoardRecordingWithOptions(request: ResumeWhiteBoardRecordingRequest, runtime: Util.RuntimeOptions): ResumeWhiteBoardRecordingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.recordId)) {
    body['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ResumeWhiteBoardRecording',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resumeWhiteBoardRecording(request: ResumeWhiteBoardRecordingRequest): ResumeWhiteBoardRecordingResponse {
  var runtime = new Util.RuntimeOptions{};
  return resumeWhiteBoardRecordingWithOptions(request, runtime);
}

model SetAppCallbackTypeRequest {
  appCallbackType?: string(name='AppCallbackType'),
  appID?: string(name='AppID'),
}

model SetAppCallbackTypeResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetAppCallbackTypeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAppCallbackTypeResponseBody(name='body'),
}

async function setAppCallbackTypeWithOptions(request: SetAppCallbackTypeRequest, runtime: Util.RuntimeOptions): SetAppCallbackTypeResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appCallbackType)) {
    body['AppCallbackType'] = request.appCallbackType;
  }
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetAppCallbackType',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAppCallbackType(request: SetAppCallbackTypeRequest): SetAppCallbackTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAppCallbackTypeWithOptions(request, runtime);
}

model SetAppCallbackUrlRequest {
  appCallbackAuthKey?: string(name='AppCallbackAuthKey'),
  appCallbackUrl?: string(name='AppCallbackUrl'),
  appID?: string(name='AppID'),
}

model SetAppCallbackUrlResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetAppCallbackUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAppCallbackUrlResponseBody(name='body'),
}

async function setAppCallbackUrlWithOptions(request: SetAppCallbackUrlRequest, runtime: Util.RuntimeOptions): SetAppCallbackUrlResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appCallbackAuthKey)) {
    body['AppCallbackAuthKey'] = request.appCallbackAuthKey;
  }
  if (!Util.isUnset(request.appCallbackUrl)) {
    body['AppCallbackUrl'] = request.appCallbackUrl;
  }
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetAppCallbackUrl',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAppCallbackUrl(request: SetAppCallbackUrlRequest): SetAppCallbackUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAppCallbackUrlWithOptions(request, runtime);
}

model SetAppDomainNamesRequest {
  appDomainNames?: string(name='AppDomainNames'),
  appID?: string(name='AppID'),
}

model SetAppDomainNamesResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetAppDomainNamesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAppDomainNamesResponseBody(name='body'),
}

async function setAppDomainNamesWithOptions(request: SetAppDomainNamesRequest, runtime: Util.RuntimeOptions): SetAppDomainNamesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appDomainNames)) {
    body['AppDomainNames'] = request.appDomainNames;
  }
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetAppDomainNames',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAppDomainNames(request: SetAppDomainNamesRequest): SetAppDomainNamesResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAppDomainNamesWithOptions(request, runtime);
}

model SetAppNameRequest {
  appID?: string(name='AppID'),
  appName?: string(name='AppName'),
}

model SetAppNameResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetAppNameResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAppNameResponseBody(name='body'),
}

async function setAppNameWithOptions(request: SetAppNameRequest, runtime: Util.RuntimeOptions): SetAppNameResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.appName)) {
    body['AppName'] = request.appName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetAppName',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAppName(request: SetAppNameRequest): SetAppNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAppNameWithOptions(request, runtime);
}

model SetAppStatusRequest {
  appID?: string(name='AppID'),
  appStatus?: long(name='AppStatus'),
}

model SetAppStatusResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetAppStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAppStatusResponseBody(name='body'),
}

async function setAppStatusWithOptions(request: SetAppStatusRequest, runtime: Util.RuntimeOptions): SetAppStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.appStatus)) {
    body['AppStatus'] = request.appStatus;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetAppStatus',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAppStatus(request: SetAppStatusRequest): SetAppStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAppStatusWithOptions(request, runtime);
}

model SetUsersPermissionsRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  permissionType?: string(name='PermissionType'),
  userIds?: string(name='UserIds'),
}

model SetUsersPermissionsResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: boolean(name='Result'),
}

model SetUsersPermissionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetUsersPermissionsResponseBody(name='body'),
}

async function setUsersPermissionsWithOptions(request: SetUsersPermissionsRequest, runtime: Util.RuntimeOptions): SetUsersPermissionsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.permissionType)) {
    body['PermissionType'] = request.permissionType;
  }
  if (!Util.isUnset(request.userIds)) {
    body['UserIds'] = request.userIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetUsersPermissions',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setUsersPermissions(request: SetUsersPermissionsRequest): SetUsersPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return setUsersPermissionsWithOptions(request, runtime);
}

model StartWhiteBoardRecordingRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  userId?: string(name='UserId'),
}

model StartWhiteBoardRecordingResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    recordId?: string(name='RecordId'),
    startTime?: long(name='StartTime'),
  }(name='Result'),
}

model StartWhiteBoardRecordingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StartWhiteBoardRecordingResponseBody(name='body'),
}

async function startWhiteBoardRecordingWithOptions(request: StartWhiteBoardRecordingRequest, runtime: Util.RuntimeOptions): StartWhiteBoardRecordingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartWhiteBoardRecording',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startWhiteBoardRecording(request: StartWhiteBoardRecordingRequest): StartWhiteBoardRecordingResponse {
  var runtime = new Util.RuntimeOptions{};
  return startWhiteBoardRecordingWithOptions(request, runtime);
}

model StopWhiteBoardRecordingRequest {
  appID?: string(name='AppID'),
  docKey?: string(name='DocKey'),
  recordId?: string(name='RecordId'),
  userId?: string(name='UserId'),
}

model StopWhiteBoardRecordingResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMsg?: string(name='ErrorMsg'),
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  result?: {
    stopTime?: long(name='StopTime'),
  }(name='Result'),
}

model StopWhiteBoardRecordingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopWhiteBoardRecordingResponseBody(name='body'),
}

async function stopWhiteBoardRecordingWithOptions(request: StopWhiteBoardRecordingRequest, runtime: Util.RuntimeOptions): StopWhiteBoardRecordingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appID)) {
    body['AppID'] = request.appID;
  }
  if (!Util.isUnset(request.docKey)) {
    body['DocKey'] = request.docKey;
  }
  if (!Util.isUnset(request.recordId)) {
    body['RecordId'] = request.recordId;
  }
  if (!Util.isUnset(request.userId)) {
    body['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StopWhiteBoardRecording',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopWhiteBoardRecording(request: StopWhiteBoardRecordingRequest): StopWhiteBoardRecordingResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopWhiteBoardRecordingWithOptions(request, runtime);
}

